﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using WebService.DataAccess;using WebService.BusinessEntities;

namespace WebService.DataAccess
{
    /// <summary>
    /// Construct a UsersFriends object from a datareader.
    /// </summary>
    internal class GET_ALL_USERS_FRIENDS_PROCFactory : IDomainObjectFactory<UsersFriends>
    {
        public UsersFriends Construct(IDataReader reader)
        {
            UsersFriends usersFriends = new UsersFriends();

            int user_1_idIndex = reader.GetOrdinal("user_1_id");
            if (!reader.IsDBNull(user_1_idIndex))
            {
                usersFriends.user_1_id = reader.GetInt32(user_1_idIndex);

            }

            int user_2_idIndex = reader.GetOrdinal("user_2_id");
            if (!reader.IsDBNull(user_2_idIndex))
            {
                usersFriends.user_2_id = reader.GetInt32(user_2_idIndex);

            }


            return usersFriends;
        }
    }
}

